<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>异步请求</title>
    <script src="js/jquery-1.4.4.min.js"></script>
</head>
<body>
<input type="button" value="Get" onclick="clickGet()">
<input type="button" value="Post" onclick="clickPost()">
</body>
<script type="text/javascript">
    function clickGet(){
        var param = { "id":1,"name":"张三","sex":'男'};
        //发送异步请求
        $.ajax({
            type:"get",
            data:param,//数据
            URL:"/Test/springMVCJson", //路径
            //dataType:,//响应数据类型
            contentType:"application/json",//内容类型
            success:function (data){//成功之后输出
                alert(data);                    
            },
            error:function (data){//失败之后输出
                console.log();
            }
            
        
        });
    }
    
</script>
</html>